
import Relay from "react-relay";
export default class FindAllProWorkGroupMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { findAllProWorkGroup }`;
    }

    getVariables() { 
        return {
            argsInput: {
                workShopId: this.props.workShopId,//车间ID
                enterpriseId: this.props.enterpriseId,//企业ID
                operateUser: this.props.operateUser,//操作人名称-登录用户名称
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on findAllProWorkGroupPayload  {
            findAllProWorkGroup {
                errorCode
                value
                totalResult
                id
                cutWorkGroupList{
                    workGroupId
                    workShopId
                    enterpriseId
                    name
                    groupType
                    workerNum
                    proTaskList{
                        styleNo
                    }
                    freeDays
                }
                tailorWorkGroupList{
                    workGroupId
                    workShopId
                    enterpriseId
                    name
                    groupType
                    workerNum
                    proTaskList{
                        styleNo
                    }
                    freeDays
                }
                cleanWorkGroupList{
                    workGroupId
                    workShopId
                    enterpriseId
                    name
                    groupType
                    workerNum
                    proTaskList{
                        styleNo
                    }
                    freeDays
                }
                packWorkGroupList{
                    workGroupId
                    workShopId
                    enterpriseId
                    name
                    groupType
                    workerNum
                    proTaskList{
                        styleNo
                    }
                    freeDays
                }
               
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
               fragment on findAllProWorkGroupPayload  {
                    findAllProWorkGroup {
                        errorCode
                        value
                        totalResult
                        id
                        cutWorkGroupList{
                            workGroupId
                            workShopId
                            enterpriseId
                            name
                            groupType
                            workerNum
                            proTaskList{
                                styleNo
                            }
                            freeDays
                        }
                        tailorWorkGroupList{
                            workGroupId
                            workShopId
                            enterpriseId
                            name
                            groupType
                            workerNum
                            proTaskList{
                                styleNo
                            }
                            freeDays
                        }
                        cleanWorkGroupList{
                            workGroupId
                            workShopId
                            enterpriseId
                            name
                            groupType
                            workerNum
                            proTaskList{
                                styleNo
                            }
                            freeDays
                        }
                        packWorkGroupList{
                            workGroupId
                            workShopId
                            enterpriseId
                            name
                            groupType
                            workerNum
                            proTaskList{
                                styleNo
                            }
                            freeDays
                        }
                    }
                 }
            `]
        }];
    }

}
